<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引包 -->
    <script src="../js/vue.js"></script>
    <style>
        .container {
            width: 400px;
            min-height: 400px;
            margin: 50px auto;
        }

        .show {
            width: 100%;
            height: 300px;
            background-color: #aef;
        }
    </style>
</head>

<body>
    <!-- 容器|模板 -->
    <div id="app">
        <div class="container">
            <div class="show" :style="{background:`rgb(${r},${g},${b})`}"></div>
            <hr>
            <div class="from">
                R: <input type="range" v-model="r" min="0" max="255"><br>
                G: <input type="range" v-model="g" min="0" max="255"><br>
                B: <input type="range" v-model="b" min="0" max="255">
            </div>
        </div>
    </div>
</body>

</html>
<script>
    //关联VM
    const VM = new Vue({
        el: '#app',
        data:{
                r: 0,
                g: 0,
                b: 0
        }
    })
</script>